<template>
	<uni-section title="意见列表" type="line">
		<uni-list>
			<view v-for="(i, index) in suggestion" :key="index">
				<uni-list-item :title="i.title" :note="i.classone==1?'生活日常':'教学日常'" showArrow thumb="/static/images/tabbar/work.png"
					thumb-size="base" rightText="查看详情" />
			</view>
		</uni-list>
		<view class="floatbtn">
		<uni-fab ref="fab" :pattern="pattern" :horizontal="horizontal" :popMenu="false" :vertical="vertical"
			:direction="direction" @fabClick="fabClick"/></view>
	</uni-section>
</template>

<script>
	export default {
		data() {
			return {
				suggestion: []
			}
		},
		methods: {
			fabClick() {
				uni.navigateTo({
					url: '/pages/els/content/content5'
				});
			},
			onShow() {
				var _this = this;
				uni.getStorage({
					key: 'App-Token',
					success(res) {
						_this.token = res.data;
						uni.request({
							url: 'http://xg.kystu.cn:8085/system/suggestion/list',
							method: "GET",
							header: {
								'Authorization': "Bearer " + _this.token
							},
							success: (res) => {
								if (res.data
									.code ==
									200) {
									uni.showToast({
										title: "查询成功",
										icon: 'exception',
										duration: 850
									});
									console.log(res.data.rows)
									_this.suggestion = res.data.rows;
								}
							}
						});
					}
				})
			}
		}
	}
</script>

<style>
.floatbtn {
 position: fixed;
    display: flex;
    flex-direction: column;
    right: 55px;
    bottom: 80px;
    z-index: 10;
    padding: 2px 2px 0 2px;
    border-radius: 3px;
/*    width: 150px; */
	}


</style>
